home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat4 / ifl / pgm.z / pgm
Encoding:
Text File  |  1998-10-20  |  4.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ppppggggmmmm((((5555))))            IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll             ppppggggmmmm((((5555))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      pgm - portable graymap file format
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      The portable graymap format is a lowest common denominator grayscale file
  13.      format.  The definition is as follows:
  14.  
  15.      - A "magic number" for identifying the file type.  A pgm file's magic
  16.        number is the two characters "P2".
  17.  
  18.      - Whitespace (blanks, TABs, CRs, LFs).
  19.  
  20.      - A width, formatted as ASCII characters in decimal.
  21.  
  22.      - Whitespace.
  23.  
  24.      - A height, again in ASCII decimal.
  25.  
  26.      - Whitespace.
  27.  
  28.      - The maximum gray value, again in ASCII decimal.
  29.  
  30.      - Whitespace.
  31.  
  32.      - Width * height gray values, each in ASCII decimal, between 0 and the
  33.        specified maximum value, separated by whitespace, starting at the top-
  34.        left corner of the graymap, proceeding in normal English reading order.
  35.        A value of 0 means black, and the maximum value means white.
  36.  
  37.      - Characters from a "#" to the next end-of-line are ignored (comments).
  38.  
  39.      - No line should be longer than 70 characters.
  40.  
  41.      Here is an example of a small graymap in this format:
  42.      P2
  43.      # feep.pgm
  44.      24 7
  45.      15
  46.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  47.      0  3  3  3  3  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15 15 15 15  0
  48.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0 15  0
  49.      0  3  3  3  0  0  0  7  7  7  0  0  0 11 11 11  0  0  0 15 15 15 15  0
  50.      0  3  0  0  0  0  0  7  0  0  0  0  0 11  0  0  0  0  0 15  0  0  0  0
  51.      0  3  0  0  0  0  0  7  7  7  7  0  0 11 11 11 11  0  0 15  0  0  0  0
  52.      0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
  53.  
  54.      Programs that read this format should be as lenient as possible,
  55.      accepting anything that looks remotely like a graymap.
  56.  
  57.      There is also a variant on the format, available by setting the RAWBITS
  58.      option at compile time.  This variant is different in the following ways:
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ppppggggmmmm((((5555))))            IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll             ppppggggmmmm((((5555))))
  71.  
  72.  
  73.  
  74.      - The "magic number" is "P5" instead of "P2".
  75.  
  76.      - The gray values are stored as plain bytes, instead of ASCII decimal.
  77.  
  78.      - No whitespace is allowed in the grays section, and only a single
  79.        character of whitespace (typically a newline) is allowed after the
  80.        maxval.
  81.  
  82.      - The files are smaller and many times faster to read and write.
  83.  
  84.      Note that this raw format can only be used for maxvals less than or equal
  85.      to 255.  If you use the _p_g_m library and try to write a file with a larger
  86.      maxval, it will automatically fall back on the slower but more general
  87.      plain format.
  88.  
  89. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  90.      fitstopgm(1), fstopgm(1), hipstopgm(1), lispmtopgm(1), psidtopgm(1),
  91.      rawtopgm(1), pgmbentley(1), pgmcrater(1), pgmedge(1), pgmenhance(1),
  92.      pgmhist(1), pgmnorm(1), pgmoil(1), pgmramp(1), pgmtexture(1),
  93.      pgmtofits(1), pgmtofs(1), pgmtolispm(1), pgmtopbm(1), pnm(5), pbm(5),
  94.      ppm(5)
  95.  
  96. AAAAUUUUTTTTHHHHOOOORRRR
  97.      Copyright (C) 1989, 1991 by Jef Poskanzer.
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.